package xunhuan;


import java.util.Random;
import java.util.Scanner;

public class test14 {
    public static  void main(String[] args) {
        Random r = new Random();
        int number = r.nextInt(100) + 1;

        while (true) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入要猜测的数字");
            int guess = sc.nextInt();
            if (guess > number) {
                System.out.println("猜大了");

            } else if (guess < number) {
                System.out.println("猜小了");
            } else {
                System.out.println("猜对了");
                break;
            }


        }
    }
}
